const filters = {
	currency(v,type="￥",len=2){
		console.log(v);
		return type+v.toFixed(len);
	},
	date(v){
		const time = new Date(v);
		return time.getFullYear()+"-"+
			(time.getMonth()+1).toString().padStart(2,0)+"-"+
			time.getDate().toString().padStart(2,0)+" "+
			time.getHours().toString().padStart(2,0)+":"+
			time.getMinutes().toString().padStart(2,0)+":"+
			time.getSeconds().toString().padStart(2,0);
	},
	img(url){
		if(url)
			return "/api"+url;
		else return "/favicon.ico"
	}
};
export default function(Vue){
	for(let key in filters){
		Vue.filter(key,filters[key]);
	}
}